(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <stdio.h>
#include <aros/bigendianio.h>
#include <proto/alib.h>
BOOL WriteStruct()
SYNOPSIS
struct Hook * hook
void * data
void * stream
const IPTR * sd

FUNCTION
Writes one big endian structure to a streamhook.

INPUTS
hook
Write to this streamhook
data
Data to be written
stream
Stream passed to streamhook
sd
Description of the structure to be written. The first element is the size of the structure.
RESULT
The function returns TRUE on success and FALSE otherwise. In error, you can examine IoErr() to find out what was wrong.

NOTES
This function writes big endian values to a file even on little endian machines.

EXAMPLE
See ReadStruct()
BUGS
INTERNALS
The function uses the Write*()-functions to write data into the file.

Pointers are written as <valid><data structure>, where valid is a byte with the values 1 (then the full data structure follows) or 0 (then nothing follows and the pointer will be intialized as NULL when the structure is read back).

SEE ALSO
ReadByte(), ReadWord(), ReadLong(), ReadFloat(), ReadDouble(), ReadString(), ReadStruct(), WriteByte(), WriteWord(), WriteLong(), WriteFloat(), WriteDouble(), WriteString(), WriteStruct()
HISTORY
27.03.1997 ldp
libaros.a -> libarossupport.a